

# 对称二叉树


class Solution:

    def isSymmetric(self, root):

        if not root:
            return True
        
        def recur(L, R):

            if not L and not R:
                return True
            
            if not L or not R or L.val != R.val:

                return False
            
            # 判断是否对称的二叉树
            return recur(L.left, R.right) and recur(L.right, R.left)
        
        return recur(root.left, root.right)


